//
//  WPDrawCashViewModel.m
//  ZhongChouPingTai
//
//  Created by WeiPan on 16/4/15.
//  Copyright © 2016年 WPJoe. All rights reserved.
//

#import "WPDrawCashViewModel.h"

@implementation WPDrawCashViewModel
+ (void)drawCashWithMoneyCount:(NSString *)moneyCount andWithAccountName:(NSString *)accountName andWithAccount:(NSString *)account andWithCode:(NSString *)code andPayPwd:(NSString *)payPwd andSuccessBlock:(void (^)(NSString *))success andFailureBlock:(void (^)(NSString *))failure {
    NSDictionary * params = @{@"paypwd":payPwd,
                              @"accountname":accountName,
                              @"account":account,
                              @"money":moneyCount,
                              @"captcha":code,
                              @"name":[UserModel defaultUser].phoneNumber};
    [NetWorkingManager postWithUrl:@"moveSoftware/acquireMoney.jhtml" requestParams:[NetWorkingManager paramsByAppendingUserInfo:params] SuccessHandler:^(id responseObject) {
        if (responseObject[@"resultType"] && [responseObject[@"resultType"] integerValue]) {
            success(@"提现申请已提交");
        } else {
            failure(responseObject[@"resultMsg"]?responseObject[@"resultMsg"]:@"提交失败");
        }
    } failureHandler:^(NSError *error) {
        failure(error.localizedDescription);
    }];
}
@end
